#ifndef _MAP_H
#define _MAP_H

//includes
#include <allegro.h>
#include "globals.h"
#include "alleg.h"

//defines
#define LEFT                0
#define RIGHT               1
#define UP                  2
#define DOWN                3
#define TILE_NO_COLL        0
#define TILE_COLL           1
#define TILE_DAMAGE         2
#define TILE_DESTROY        3
#define TILE_NO_MOVE        0
#define TILE_UP             1
#define TILE_DOWN           2
#define TILE_RIGHT          3
#define TILE_LEFT           4

//Globals 

struct TILE{
    int      bmp;                                //bitmap index of tile
    int      x1;                                 //X coordinate location
    int      y1;                                 //Y coordinate location
    int      x2;                                 //X coordinate offset
    int      y2;                                 //Y coordinate offset
    int      att;                               //Current Attribute of Tile
    int      mov;                               //Direction if moveable
    int      energy;                            //Resistence before it can be destroyed
}tiles[MAP_H][MAP_W];

int map[MAP_H][MAP_W];

int     map_x,map_y,
        cam_x,cam_y,
        cam_xoff,cam_yoff;

                        
//function declarations
void init_map(void);                                       //Initialize the map
void draw_map(short map_x,short map_y);                    //Draw editor map
void destroy_tiles(void);                                  //Destroys the tileset
void move_camera(int dir);                                 //Moves camera in desired direction
int save_map(BITMAP *back);                                       //Save map data
int load_map(BITMAP *back);                                       //Load map data

#endif
